<style type="text/css">
        .pay-box{
            background-color: #fff;
            border-radius: 5px;
            padding: 20px;
        }
        .pay-title{
            padding: 10px 0;
            text-align: center;
        }
        .pay-title span{
            color: #2b85e4;
        }
        .pay-title .price{
            font-weight: 900;
            color: #dd6161;
        }
        .pay-qrcode{
            width: 100%;
        }
        .pay-qrcode .qrcode{
            width: 49%;
            display:inline-block;
        }
        .pay-qrcode .qrcode img{
            width: 100%;
            height: 100%;
        }
        .pay-qrcode .scan{
            width: 210px;
            display:inline-block;
            height: 210px;
            float: right;
        }
        .pay-qrcode .scan img{
            width: 210px;
            height: 210px;
        }
    </style>
{if get_addon_info('wxpaypos')}
  <div style="padding:10px;max-width:500px;margin:0 auto;">
      <div class="pay-box">
          <div class="am-tabs" data-am-tabs="{noSwipe: 1}" id="doc-tab-demo-1">
            <ul class="am-tabs-nav am-nav am-nav-tabs">
              <li class="{$shop_type==10?'am-active':''}"><a href="javascript: void(0)" id="pay-10">单门店版</a></li>
              <li class="{$shop_type==20?'am-active':''}"><a href="javascript: void(0)" id="pay-20">多门店版</a></li>
            </ul>
            <div class="am-tabs-bd">
              <div class="am-tab-panel {$shop_type==10?'am-active':''}">
                  <div class="am-alert am-alert-danger">
                      包含所有功能，但是只能创建一个门店。
                  </div>
              </div>
              <div class="am-tab-panel {$shop_type==20?'am-active':''}">
                  <div class="am-alert am-alert-success">
                      包含所有功能，可以创建多门店（连锁经营）。
                  </div>
              </div>
            </div>
            <div class="pay-title">
              购买《<span>{$model.title}</span>》插件，需支付 
              <span class="price">￥<?= $shop_type==10?$model['single_price']:$model['many_price'] ?>元</span>
            </div>
            <div class="pay-qrcode">
                  <div id="qrcode" class="qrcode"></div>
                  <div id="qrcode" class="scan">
                      <img src="/assets/img/index/scan.jpg" />
                  </div>
            </div>
          </div>
      </div>
  </div>
{else/}
    <div class="no-addon">需要安装《<span>微信支付商户版</span>》 插件</div>
{/if}
<script src="/assets/plugins/qrcode/qrcode.min.js"></script>
<script type="text/javascript">
    new QRCode(document.getElementById("qrcode"), "<?= $code_url?>"); 
    $(function () {
        $('#pay-10').click(function(){
            let url = "{:url('formwork/buy')}?id={$model.id}&shop_type=10";
            window.location.href = url;
        });
        $('#pay-20').click(function(){
            let url = "{:url('formwork/buy')}?id={$model.id}&shop_type=20";
            window.location.href = url;
        });
    });
</script>  